package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 审核状态（1-待审核，2-已通过，3-未通过，4-待认证）
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum AuditStateEnum {

    WAIT_AUDIT(1, "待审核"),
    SUCCESS(2, "已通过"),
    FAIL(3, "未通过"),
    WAIT_AUTH(4, "待认证"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    AuditStateEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static AuditStateEnum typeOf(Integer value) {
        AuditStateEnum[] values = AuditStateEnum.values();
        for (AuditStateEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static AuditStateEnum typeOf(String name) {
        AuditStateEnum[] values = AuditStateEnum.values();
        for (AuditStateEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
